<template>
	<view class="wf-box">
		<HeadNav titleName="发送Binance(BSC)" :navBarHeight="navBarHeight"></HeadNav>
		

		<view class="main" :style="{ paddingTop: navBarHeight }">
			<view class="main-ctr">
				<view class="ctr-up">
					<text>价值</text>
					<text>Binabce(BSC)</text>
				</view>
				<view class="ctr-coin">
					<view @click="openPopup">
						<image src="../../static/img/demo-03.png" class="coin-img"></image>
						<text>BNB</text>
						<image src="../../static/img/me-41.png" class="coin-more"></image>
					</view>
				</view>

				<view class="ctr-mxm">
					<view class="mxm-warp">
						<input type="text">
					</view>
					<view class="mxm-row">
						<view>使用最大值</view>
						<view>可用：0 BNB</view>
					</view>
				</view>
			</view>

			<view class="main-cjr">
				<view class="cjr-tit">接收人</view>
				<view class="cjr-warp">
					<input type="text" placeholder="请输入接收者的地址">
					<image src="../../static/img/me-42.png"></image>
				</view>
			</view>

			<view class="foot">
				<view @click="next">下一步</view>
			</view>
		</view>

		<uni-popup ref="popup" background-color="transparent" border-radius="8px 8px 0 0" type="bottom">
			<view class="network-box transit">
				<view class="network-title">选择通证 <image src="../../static/img/me-21.png" @click="closePopup()"></image>
				</view>

				<view class="transit-search">
					<image src="../../static/img/search.png"></image>
					<input type="text" placeholder="搜索 token">
				</view>

				<view class="network-scroll">
					<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
						<view class="scroll-view-item" v-for="item in coinList" @click="jumpBsc(item)">
							<image src="../../static/img/demo-03.png" class="coin-img"></image>
							<!-- <text>Binance(BSC)</text> -->
							<text>{{ item.text }}</text>
							<view class="status">
								0
							</view>

						</view>
					</scroll-view>
				</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="popup2" background-color="transparent" border-radius="8px 8px 0 0" type="bottom">
			<view class="network-box trade-box">
				<view class="network-title">确认交易 <image src="../../static/img/me-21.png" @click="closePopup()"></image>
				</view>
				<view class="trade-item-head">
					<view class="trade-item-up">
						<text>余额</text>
						<text>0 BNB</text>
					</view>
					<view class="trade-item-down">
						(待确认：0 BNB)
					</view>
				</view>
				<view class="trade-item">
					<view class="trade-lf">网络</view>
					<view class="trade-rt">
						<image src="../../static/img/demo-03.png"></image>Binance(BSC)
					</view>
				</view>
				
				<view class="trade-item">
					<view class="trade-lf">速度</view>
					<view class="trade-rt">
						&lt; 0.00019BNB
					</view>
				</view>
				
				<view class="trade-item">
					<view class="trade-lf">接收人</view>
					<view class="trade-rt">
						0x8382...aa7b
					</view>
				</view>
				
				<view class="trade-item">
					<view class="trade-lf">价值</view>
					<view class="trade-rt">
						0 BNB
					</view>
				</view>
				
				<view class="trade-foot">
					<view @click="config">确认</view>
				</view>
				
			</view>
		</uni-popup>
		
		<uni-popup ref="popup3" type="center">
			<view class="popup-box">
				<view class="popup-title">资金不够！</view>
				<view class="popup-sub">我们估计此交易将因资金不足而失败。 你想继续尝试发送吗？</view>
				<view class="popup-footer">
					<view class="cancle" @click="closePopup()">发送</view>
					<view class="confim">取消交易</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import HeadNav from "@/components/HeadNav"
	import navBarMixin from '@/mixin/navBarMixin.js'
	export default {
		data() {
			return {
				
			}
		},
		components: {
			HeadNav
		},
		mixins: [navBarMixin],
		methods: {
			back() {
				uni.navigateBack()
			},
			
			openPopup() {
				this.$refs.popup.open()
			},
			next() {
				this.$refs.popup2.open()
			},
			closePopup() {
				this.$refs.popup.close()
				this.$refs.popup2.close()
				this.$refs.popup3.close()
			},
			config() {
				this.$refs.popup3.open()
				// this.closePopup()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wf-box {
		overflow: hidden;

		.main {
			padding: 0 30rpx;
			margin-top: 126rpx;

			.main-ctr {
				padding: 30rpx;
				background: #fff;
				border-radius: 10rpx;

				.ctr-up {
					display: flex;
					justify-content: space-between;
					align-items: center;

					text:last-child {
						line-height: 44rpx;
						padding: 10rpx;
						background: #F3BA2F;
						font-size: 24rpx;
						color: #fff;
					}
				}

				.ctr-coin {
					
					margin-top: 60rpx;
					
					&>view {
						display: flex;
						align-items: center;
					}

					.coin-img {
						width: 70rpx;
						height: 70rpx;
					}

					text {
						margin: 0 20rpx;
						font-size: 40rpx;
						color: #333;
					}

					.coin-more {
						width: 20rpx;
						height: 10rpx;
					}
				}

				.ctr-mxm {
					.mxm-warp {
						margin-top: 20rpx;
						height: 100rpx;
						border-bottom: 2rpx solid #333;

						input {
							height: 100%;
						}
					}

					.mxm-row {
						display: flex;
						justify-content: space-between;
						margin-top: 20rpx;

						view:first-child {
							font-size: 24rpx;
							color: $theme-color-a;
						}

						view:last-child {
							font-size: 24rpx;
							color: #666;
						}
					}
				}
			}

			.main-cjr {
				padding: 30rpx;
				margin-top: 30rpx;
				border-radius: 10rpx;
				background: #fff;

				.cjr-warp {
					display: flex;
					align-items: center;
					height: 80rpx;
					padding: 0 30rpx;
					margin-top: 20rpx;
					background: #F8F8F8;

					input {
						height: 100%;
						flex: 1;
						font-size: 24rpx;
					}

					image {
						width: 48rpx;
						height: 48rpx;
					}
				}
			}

			.foot {
				padding: 0 50rpx;
				margin-top: 236rpx;

				&>view {
					height: 80rpx;
					line-height: 80rpx;
					background: $theme-color-a;
					text-align: center;
					border-radius: 40rpx;
					color: #fff;
				}
			}
		}
	
		.network-box {
			min-height: 920rpx;
			background-color: #fff;
			border-radius: 24rpx 24rpx 0 0;
			overflow: hidden;
		
			.network-title {
				position: relative;
				height: 160rpx;
				line-height: 160rpx;
				text-align: center;
				color: #333;
				font-size: 32rpx;
				font-weight: bold;
				background: linear-gradient(180deg, #EBF3FF 0%, #FFFFFF 100%);
		
				image {
					position: absolute;
					width: 40rpx;
					height: 40rpx;
					right: 30rpx;
					top: 60rpx;
				}
			}
		
			.network-scroll {
				height: 504rpx;
				padding: 0 30rpx;
		
				.scroll-Y {
					height: 100%;
					overflow: hidden;
				}
		
				.scroll-view-item {
					height: 126rpx;
					display: flex;
					align-items: center;
					border-bottom: 2rpx solid #eee;
		
					.coin-img {
						width: 56rpx;
						height: 56rpx;
					}
		
					text {
						margin-left: 20rpx;
					}
		
					.status {
						margin-left: auto;
		
						image {
							width: 30rpx;
							height: 30rpx;
						}
					}
		
		
				}
			}
		
			.network-add {
				padding: 0 65rpx;
				margin-top: 90rpx;
		
				.network-btn {
					background: $theme-color-a;
					height: 80rpx;
					border-radius: 40rpx;
					display: flex;
					align-items: center;
		
					&>view {
						display: flex;
						align-items: center;
						width: max-content;
						margin: 0 auto;
						color: #fff;
						font-size: 28rpx;
		
						text {
							font-weight: bold;
							font-size: 28rpx;
						}
		
					}
		
					image {
						margin-right: 18rpx;
						width: 20rpx;
						height: 20rpx;
					}
				}
		
			}
			
			&.transit {
				min-height: 700rpx;
				.transit-search {
					height: 80rpx;
					margin: 0 30rpx;
					background: #F4F4F4;
					border-radius: 40rpx;
					padding: 0 30rpx;
					display: flex;
					align-items: center;
					image {
						width: 48rpx;
						height: 48rpx;
					}
					input {
						flex: 1;
						margin-left: 20rpx;
						height: 100%;
					}
				}
			}
			
			&.trade-box {
				min-height: 890rpx;
				
				.trade-item-head {
					margin: 0 30rpx;
					padding-bottom: 30rpx;
					border-bottom: 2rpx solid #eee;
					.trade-item-up {
						display: flex;
						justify-content: space-between;
						text {
							font-size: 28rpx;
							color: #333;
							&:first-child {
								color: #666;
							}
						}
					}
					.trade-item-down {
							margin-top: 15rpx;
							text-align: right;
							font-size: 28rpx;
							color: #999;
					}
				}
				.trade-item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 0 30rpx;
					height: 100rpx;
					border-bottom: 2rpx solid #eee;
					.trade-lf {
						color: #666;
						font-size: 28rpx;
					}
					.trade-rt {
						display: flex;
						font-size: 28rpx;
						color: #333;
						image {
							margin-right: 15rpx;
							width: 40rpx;
							height: 40rpx;
						}
					}
				}
				.trade-foot {
					padding: 0 66rpx;
					margin-top: 70rpx;
					&>view {
						height: 80rpx;
						line-height: 80rpx;
						text-align: center;
						background: $theme-color-a;
						color: #fff;
						border-radius: 40rpx;
					}
				}
			}
		
		}
	
		.popup-box {
			width: 560rpx;
			// height: 528rpx;
			padding: 0 50rpx;
			padding-top: 140rpx;
			padding-bottom: 40rpx;
			border-radius: 20rpx;
			box-sizing: border-box;
			background: #fff;
			// background: url('../../static/img/me-32.png') no-repeat;
			// background-size: 100% 100%;
			.popup-title {
				font-size: 32rpx;
				color: #FF534E;
				font-weight: bold;
				text-align: center;
			}
			.popup-sub {
				margin-top: 36rpx;
				color: #666;
				font-size: 28rpx;
				text-align: center;
			}
			.popup-footer {
				display: flex;
				justify-content: space-between;
				margin-top: 70rpx;
				.cancle {
					width: 200rpx;
					line-height: 76rpx;
					text-align: center;
					border: 2rpx solid #3F93FF;
					border-radius: 40rpx;
				}
				.confim {
					width: 200rpx;
					line-height: 76rpx;
					text-align: center;
					border-radius: 40rpx;
					background: #3F93FF;
					color: #fff;
				}
			}
		}
	}
</style>